using Common.Logging;
using System;
using System.Diagnostics;
namespace AppToolKit.Core.Logging
{
	public class LoggerHelper
	{
		private static string[] filters_ = new string[]
		{
			"AppToolKit.Service.Component.Message",
			"AppToolKit.Core.AppObjectBase.LogError",
			"AppToolKit.Core.AppObjectBase.DebugFormat",
			"AppToolKit.Core.AppObjectBase.InfoFormat"
		};
		public ILog GetMainLogger()
		{
			return LogManager.GetLogger("App-Info");
		}
		public ILog GetErrorLogger()
		{
			return LogManager.GetLogger("App-Error");
		}
		public ILog GetLogger(string logName)
		{
			return LogManager.GetLogger(logName);
		}
		public ILog GetLogger(Type type)
		{
			return LogManager.GetLogger(type);
		}
		public ILog GetDebugLogger()
		{
			return LogManager.GetLogger("App-Debug");
		}
		public static string GetCallingMethod()
		{
			StackTrace stackTrace = new StackTrace();
			string result;
			for (int i = 2; i < stackTrace.FrameCount; i++)
			{
				StackFrame frame = stackTrace.GetFrame(i);
				string text = string.Format("{0}.{1}", frame.GetMethod().DeclaringType.FullName, frame.GetMethod().Name);
				bool flag = false;
				string[] array = LoggerHelper.filters_;
				for (int j = 0; j < array.Length; j++)
				{
					string b = array[j];
					if (text == b)
					{
						flag = true;
						break;
					}
				}
				if (!flag)
				{
					result = text;
					return result;
				}
			}
			result = string.Empty;
			return result;
		}
	}
}
